
__all__ = []

import pyutilib
import re
import NEOS
from coopr.opt.base import *
from coopr.opt.results import *


class NEOS_CBC(NEOS.NEOSRemoteSolver):
    """A wrapper class for NEOS CBC Solvers"""

    def __init__(self, **kwds):
        kwds['type'] = 'neos_cbc'
        self.neos_name="Cbc"
        NEOS.NEOSRemoteSolver.__init__(self, **kwds)

    def create_command_line(self,executable,problem_files):
        self.tmp_opt = SolverFactory('cbc')
        self.tmp_opt._problem_format = ProblemFormat.nl
        self.tmp_opt._results_format = ResultsFormat.sol
        self.tmp_opt.create_command_line('cbc',problem_files)
        self.tmp_opt._symbol_map = self._symbol_map
        self.solver_options = self.tmp_opt._nl_options
        return NEOS.NEOSRemoteSolver.create_command_line(self,executable,problem_files)

SolverRegistration("neos_cbc", NEOS_CBC)

